
setwd("~/CurrentDirectory/")
load("EthicsSurvey.Rdata")

# This code replicates figures, tables, and in-text mentions of figures for the manuscript titled "Subjects and Scholars' Views on the Ethics of Political Science Field Experiments".
# Thanks to Rachel Schoner for RA help.

library(ggplot2)


#### table 1: descriptive states for all respondents ####
		# gender
		# female is row, citizen is column
			gender<-table(EthicsSurvey$Female,EthicsSurvey$Citizen)
			gender
			round(prop.table(gender,2),2)
		# gender wit NA (in appendix)
			gender<-table(EthicsSurvey$Female,EthicsSurvey$Citizen,useNA="ifany")
			gender
			round(prop.table(gender,2),2)
		# age 
			age<-table(EthicsSurvey$AgeString,EthicsSurvey$Citizen,useNA = "ifany")
			age
			round(prop.table(age,2),2)
		# home 
			home<-table(EthicsSurvey$Homeowner,EthicsSurvey$Citizen,useNA = "ifany")
			home
			round(prop.table(home,2),2)
		# race 
			NativeAmerican<-table(EthicsSurvey$NativeAmerican,EthicsSurvey$Citizen,useNA = "ifany")[2,]
			White<-table(EthicsSurvey$White,EthicsSurvey$Citizen,useNA = "ifany")[2,]
			Black<-table(EthicsSurvey$Black,EthicsSurvey$Citizen,useNA = "ifany")[2,]
			Latino<-table(EthicsSurvey$Latino,EthicsSurvey$Citizen,useNA = "ifany")[2,]
			Asian<-table(EthicsSurvey$Asian,EthicsSurvey$Citizen,useNA = "ifany")[2,]
			OtherRace<-table(EthicsSurvey$OtherRace,EthicsSurvey$Citizen,useNA = "ifany")[2,]
			race<-rbind(NativeAmerican,White,Black,Latino,Asian,OtherRace)
			race
			# race for subjects
			race[,2]/sum(EthicsSurvey$Citizen==1 & !is.na(EthicsSurvey$NativeAmerican)) #out of those that responded

			# race for scholars
			race[,1]/sum(EthicsSurvey$Citizen==0 & !is.na(EthicsSurvey$NativeAmerican)) #out of those that responded

		# education
		# subjects and scholars are separate here 
			education<-table(EthicsSurvey$Education,EthicsSurvey$Citizen,useNA = "ifany")[,2]
			education
			round(education/sum(education),2)
		# number of scholars 
			sum(EthicsSurvey$Citizen==0)

		# position
			position<-table(EthicsSurvey$Position,EthicsSurvey$Citizen,useNA = "ifany")[,1]
			position
			round(position/sum(position),2)
		# institution
			institution<-table(EthicsSurvey$Institution,EthicsSurvey$Citizen,useNA = "ifany")[,1]
			institution
			round(institution/sum(institution),2)

		# fields 
			american<-table(EthicsSurvey$American,EthicsSurvey$Citizen,useNA = "ifany")[2,1]
			comparative<-table(EthicsSurvey$Comparative,EthicsSurvey$Citizen,useNA = "ifany")[2,1]
			ir<-table(EthicsSurvey$IR,EthicsSurvey$Citizen,useNA = "ifany")[2,1]
			theory<-table(EthicsSurvey$Theory,EthicsSurvey$Citizen,useNA = "ifany")[2,1]
			methods<-table(EthicsSurvey$Methods,EthicsSurvey$Citizen,useNA = "ifany")[2,1]
			otherf<-table(EthicsSurvey$OtherField,EthicsSurvey$Citizen,useNA = "ifany")[2,1]
			field<-c(american,comparative,ir,theory,methods,otherf)
			field
			field/sum(EthicsSurvey$Citizen==0 & !is.na(EthicsSurvey$American)) #out of those that responded


		# ever experiment
			experiment<-table(EthicsSurvey$EverExperiment,EthicsSurvey$Citizen)[,1]
			experiment
			round(experiment/sum(experiment),2)

#### figure 1: attitudes toward informational field experiments ####
	#Citizens
			citizen<-EthicsSurvey[EthicsSurvey$Citizen==1,] #for ease, make a data set just with citizen respondents
			cplot <- data.frame(matrix(ncol = 4, nrow = 6))
			colnames(cplot)<-c("IFETreatment","IFEDeception","mean","se")
			cplot$IFETreatment<-c("DUI","DUI","Floss","Floss","GOTV","GOTV")
			cplot$IFEDeception<-rep(seq(0,1),3)
		 #floss
			cplot$mean[cplot$IFETreatment=="Floss" & cplot$IFEDeception==1]<-
			  mean(citizen$IFEAgree[citizen$IFETreatment=="Floss" & citizen$IFEDeception==1],na.rm = TRUE)
			cplot$se[cplot$IFETreatment=="Floss" & cplot$IFEDeception==1]<-
			  sd(citizen$IFEAgree[citizen$IFETreatment=="Floss" & citizen$IFEDeception==1],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="Floss" & citizen$IFEDeception==1,na.rm = TRUE))

			cplot$mean[cplot$IFETreatment=="Floss" & cplot$IFEDeception==0]<-
			  mean(citizen$IFEAgree[citizen$IFETreatment=="Floss" & citizen$IFEDeception==0],na.rm = TRUE)
			cplot$se[cplot$IFETreatment=="Floss" & cplot$IFEDeception==0]<-
			  sd(citizen$IFEAgree[citizen$IFETreatment=="Floss" & citizen$IFEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="Floss" & citizen$IFEDeception==0,na.rm = TRUE))

		 #GOTV
			cplot$mean[cplot$IFETreatment=="GOTV" & cplot$IFEDeception==1]<-
			  mean(citizen$IFEAgree[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==1],na.rm = TRUE)
			cplot$se[cplot$IFETreatment=="GOTV" & cplot$IFEDeception==1]<-
			  sd(citizen$IFEAgree[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==1],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="GOTV" & citizen$IFEDeception==1,na.rm = TRUE))
			
			cplot$mean[cplot$IFETreatment=="GOTV" & cplot$IFEDeception==0]<-
			  mean(citizen$IFEAgree[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==0],na.rm = TRUE)
			cplot$se[cplot$IFETreatment=="GOTV" & cplot$IFEDeception==0]<-
			  sd(citizen$IFEAgree[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="GOTV" & citizen$IFEDeception==0,na.rm = TRUE))

		 #DUI
			cplot$mean[cplot$IFETreatment=="DUI" & cplot$IFEDeception==1]<-
			  mean(citizen$IFEAgree[citizen$IFETreatment=="DUI" & citizen$IFEDeception==1],na.rm = TRUE)
			cplot$se[cplot$IFETreatment=="DUI" & cplot$IFEDeception==1]<-
			  sd(citizen$IFEAgree[citizen$IFETreatment=="DUI" & citizen$IFEDeception==1],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="DUI" & citizen$IFEDeception==1,na.rm = TRUE))

			cplot$mean[cplot$IFETreatment=="DUI" & cplot$IFEDeception==0]<-
			  mean(citizen$IFEAgree[citizen$IFETreatment=="DUI" & citizen$IFEDeception==0],na.rm = TRUE)
			cplot$se[cplot$IFETreatment=="DUI" & cplot$IFEDeception==0]<-
			  sd(citizen$IFEAgree[citizen$IFETreatment=="DUI" & citizen$IFEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="DUI" & citizen$IFEDeception==0,na.rm = TRUE))

		 #switch deception to consent for figure
			cplot$consent[cplot$IFEDeception==0]<-1
			cplot$consent[cplot$IFEDeception==1]<-0

			ggplot(data=cplot,
			       aes(x=IFETreatment, y=mean, group=consent))+
			  geom_errorbar(aes(ymin=(mean-1.96*se), ymax=mean+1.96*se), width=.1) +
			  scale_x_discrete(limits=c("Floss","GOTV","DUI"))+
			  geom_point()+
			  geom_line(aes(linetype = as.factor(consent)))+
			  ylim(1, 7)+
			  labs(title = "Agree Acceptable \n Subjects",linetype="Consent")+
			  xlab("Treatment") + ylab("Agree Acceptable") +theme_bw()

	#scholars 
			scholar<-EthicsSurvey[EthicsSurvey$Citizen==0,] # for ease, make a data set just with scholar respondents 
			splot <- data.frame(matrix(ncol = 4, nrow = 6))
			colnames(splot)<-c("IFETreatment","IFEDeception","mean","se")
			splot$IFETreatment<-c("DUI","DUI","Floss","Floss","GOTV","GOTV")
			splot$IFEDeception<-rep(seq(0,1),3)
		 #floss
			splot$mean[splot$IFETreatment=="Floss" & splot$IFEDeception==1]<-
			  mean(scholar$IFEAgree[scholar$IFETreatment=="Floss" & scholar$IFEDeception==1],na.rm = TRUE)
			splot$se[splot$IFETreatment=="Floss" & splot$IFEDeception==1]<-
			  sd(scholar$IFEAgree[scholar$IFETreatment=="Floss" & scholar$IFEDeception==1],na.rm = TRUE) / sqrt(sum(scholar$IFETreatment=="Floss" & scholar$IFEDeception==1,na.rm = TRUE))
			
			splot$mean[splot$IFETreatment=="Floss" & splot$IFEDeception==0]<-
			  mean(scholar$IFEAgree[scholar$IFETreatment=="Floss" & scholar$IFEDeception==0],na.rm = TRUE)
			splot$se[splot$IFETreatment=="Floss" & splot$IFEDeception==0]<-
			  sd(scholar$IFEAgree[scholar$IFETreatment=="Floss" & scholar$IFEDeception==0],na.rm = TRUE) / sqrt(sum(scholar$IFETreatment=="Floss" & scholar$IFEDeception==0,na.rm = TRUE))

		#GOTV
			splot$mean[splot$IFETreatment=="GOTV" & splot$IFEDeception==1]<-
			  mean(scholar$IFEAgree[scholar$IFETreatment=="GOTV" & scholar$IFEDeception==1],na.rm = TRUE)
			splot$se[splot$IFETreatment=="GOTV" & splot$IFEDeception==1]<-
			  sd(scholar$IFEAgree[scholar$IFETreatment=="GOTV" & scholar$IFEDeception==1],na.rm = TRUE) / sqrt(sum(scholar$IFETreatment=="GOTV" & scholar$IFEDeception==1,na.rm = TRUE))
			
			splot$mean[splot$IFETreatment=="GOTV" & splot$IFEDeception==0]<-
			  mean(scholar$IFEAgree[scholar$IFETreatment=="GOTV" & scholar$IFEDeception==0],na.rm = TRUE)
			splot$se[splot$IFETreatment=="GOTV" & splot$IFEDeception==0]<-
			  sd(scholar$IFEAgree[scholar$IFETreatment=="GOTV" & scholar$IFEDeception==0],na.rm = TRUE) / sqrt(sum(scholar$IFETreatment=="GOTV" & scholar$IFEDeception==0,na.rm = TRUE))

		#DUI
			splot$mean[splot$IFETreatment=="DUI" & splot$IFEDeception==1]<-
			  mean(scholar$IFEAgree[scholar$IFETreatment=="DUI" & scholar$IFEDeception==1],na.rm = TRUE)
			splot$se[splot$IFETreatment=="DUI" & splot$IFEDeception==1]<-
			  sd(scholar$IFEAgree[scholar$IFETreatment=="DUI" & scholar$IFEDeception==1],na.rm = TRUE) / sqrt(sum(scholar$IFETreatment=="DUI" & scholar$IFEDeception==1,na.rm = TRUE))

			splot$mean[splot$IFETreatment=="DUI" & splot$IFEDeception==0]<-
			  mean(scholar$IFEAgree[scholar$IFETreatment=="DUI" & scholar$IFEDeception==0],na.rm = TRUE)
			splot$se[splot$IFETreatment=="DUI" & splot$IFEDeception==0]<-
			  sd(scholar$IFEAgree[scholar$IFETreatment=="DUI" & scholar$IFEDeception==0],na.rm = TRUE) / sqrt(sum(scholar$IFETreatment=="DUI" & scholar$IFEDeception==0,na.rm = TRUE))

		#switch deception to consent for figure
			splot$consent[splot$IFEDeception==0]<-1
			splot$consent[splot$IFEDeception==1]<-0

			ggplot(data=splot,
			       aes(x=IFETreatment, y=mean, group=consent))+
			  geom_errorbar(aes(ymin=(mean-1.96*se), ymax=mean+1.96*se), width=.1) +
			  scale_x_discrete(limits=c("Floss","GOTV","DUI"))+
			  geom_point()+
			  geom_line(aes(linetype = as.factor(consent)))+
			  ylim(1, 7)+
			  labs(title = "Agree Acceptable \n Scholars",linetype="Consent")+
			  xlab("Treatment") + ylab("Agree Acceptable") +theme_bw()


	#Citizens
	#would rather not participate 
			nplot <- data.frame(matrix(ncol = 4, nrow = 6))
			colnames(nplot)<-c("IFETreatment","IFEDeception","mean","se")
			nplot$IFETreatment<-c("DUI","DUI","Floss","Floss","GOTV","GOTV")
			nplot$IFEDeception<-rep(seq(0,1),3)
		#floss
			nplot$mean[nplot$IFETreatment=="Floss" & nplot$IFEDeception==1]<-
			  mean(citizen$IFEWouldNot[citizen$IFETreatment=="Floss" & citizen$IFEDeception==1],na.rm = TRUE)
			nplot$se[nplot$IFETreatment=="Floss" & nplot$IFEDeception==1]<-
			  sd(citizen$IFEWouldNot[citizen$IFETreatment=="Floss" & citizen$IFEDeception==1],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="Floss" & citizen$IFEDeception==1,na.rm = TRUE))
			
			nplot$mean[nplot$IFETreatment=="Floss" & nplot$IFEDeception==0]<-
			  mean(citizen$IFEWouldNot[citizen$IFETreatment=="Floss" & citizen$IFEDeception==0],na.rm = TRUE)
			nplot$se[nplot$IFETreatment=="Floss" & nplot$IFEDeception==0]<-
			  sd(citizen$IFEWouldNot[citizen$IFETreatment=="Floss" & citizen$IFEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="Floss" & citizen$IFEDeception==0,na.rm = TRUE))

		#GOTV
			nplot$mean[nplot$IFETreatment=="GOTV" & nplot$IFEDeception==1]<-
			  mean(citizen$IFEWouldNot[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==1],na.rm = TRUE)
			nplot$se[nplot$IFETreatment=="GOTV" & nplot$IFEDeception==1]<-
			  sd(citizen$IFEWouldNot[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==1],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="GOTV" & citizen$IFEDeception==1,na.rm = TRUE))
			
			nplot$mean[nplot$IFETreatment=="GOTV" & nplot$IFEDeception==0]<-
			  mean(citizen$IFEWouldNot[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==0],na.rm = TRUE)
			nplot$se[nplot$IFETreatment=="GOTV" & nplot$IFEDeception==0]<-
			  sd(citizen$IFEWouldNot[citizen$IFETreatment=="GOTV" & citizen$IFEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="GOTV" & citizen$IFEDeception==0,na.rm = TRUE))
			
		#DUI
			nplot$mean[nplot$IFETreatment=="DUI" & nplot$IFEDeception==1]<-
			  mean(citizen$IFEWouldNot[citizen$IFETreatment=="DUI" & citizen$IFEDeception==1],na.rm = TRUE)
			nplot$se[nplot$IFETreatment=="DUI" & nplot$IFEDeception==1]<-
			  sd(citizen$IFEWouldNot[citizen$IFETreatment=="DUI" & citizen$IFEDeception==1],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="DUI" & citizen$IFEDeception==1,na.rm = TRUE))
			
			nplot$mean[nplot$IFETreatment=="DUI" & nplot$IFEDeception==0]<-
			  mean(citizen$IFEWouldNot[citizen$IFETreatment=="DUI" & citizen$IFEDeception==0],na.rm = TRUE)
			nplot$se[nplot$IFETreatment=="DUI" & nplot$IFEDeception==0]<-
			  sd(citizen$IFEWouldNot[citizen$IFETreatment=="DUI" & citizen$IFEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$IFETreatment=="DUI" & citizen$IFEDeception==0,na.rm = TRUE))

			#switch deception to consent for figure
			nplot$consent[nplot$IFEDeception==0]<-1
			nplot$consent[nplot$IFEDeception==1]<-0
			
			ggplot(data=nplot,
			       aes(x=IFETreatment, y=mean, group=consent))+
			  geom_errorbar(aes(ymin=(mean-1.96*se), ymax=mean+1.96*se), width=.1) +
			  scale_x_discrete(limits=c("Floss","GOTV","DUI"))+
			  geom_point()+
			  geom_line(aes(linetype = as.factor(consent)))+
			  ylim(0,1)+
			  labs(title = "Would Rather Not Participate \n Subjects",linetype="Consent")+
			  xlab("Treatment") + ylab("Proportion") +theme_bw()
			
	#### text ####
		##scholars##
		# mean acceptability for consent
			round(mean(scholar$IFEAgree[scholar$IFEDeception==0],na.rm = TRUE),2)
			# mean acceptabiltiy for lacked consent 
			round(mean(scholar$IFEAgree[scholar$IFEDeception==1],na.rm=TRUE),2)

		##citizens##
			# mean acceptabiltiy for consent 
			round(mean(citizen$IFEAgree[citizen$IFEDeception==0],na.rm = TRUE),2)
			# mean acceptabiltiy for lacked consent 
			round(mean(citizen$IFEAgree[citizen$IFEDeception==1],na.rm=TRUE),2)

			##differences between designs##
			#scholar
			round(mean(scholar$IFEAgree[scholar$IFEDeception==0],na.rm=TRUE) - mean(scholar$IFEAgree[scholar$IFEDeception==1],na.rm=TRUE),2)
			#citizen
			round(mean(citizen$IFEAgree[citizen$IFEDeception==0],na.rm=TRUE) - mean(citizen$IFEAgree[citizen$IFEDeception==1],na.rm=TRUE),2)
			
			#means for different designs
			#citizens
			mean(citizen$IFEAgree[citizen$IFETreatment=="DUI"],na.rm=TRUE)
			mean(citizen$IFEAgree[citizen$IFETreatment=="Floss"],na.rm=TRUE)
			mean(citizen$IFEAgree[citizen$IFETreatment=="Floss" & citizen$IFEDeception==1],na.rm=TRUE) - mean(citizen$IFEAgree[citizen$IFETreatment=="DUI" & citizen$IFEDeception==1],na.rm=TRUE)
			
			#scholars 
			mean(scholar$IFEAgree[scholar$IFETreatment=="DUI"],na.rm=TRUE)
			mean(scholar$IFEAgree[scholar$IFETreatment=="Floss"],na.rm=TRUE)
			mean(scholar$IFEAgree[scholar$IFETreatment=="Floss" & scholar$IFEDeception==1],na.rm=TRUE) - mean(scholar$IFEAgree[scholar$IFETreatment=="DUI" & scholar$IFEDeception==1],na.rm=TRUE)
			
			
			#without informed consent, flossing versus DUI 
			# scholars
			round(mean(scholar$IFEAgree[scholar$IFETreatment=="Floss" & scholar$IFEDeception==1],na.rm=TRUE) - mean(scholar$IFEAgree[scholar$IFETreatment=="DUI"& scholar$IFEDeception==1],na.rm=TRUE),2) 
			# subjects
			round(mean(citizen$IFEAgree[citizen$IFETreatment=="Floss" & citizen$IFEDeception==1],na.rm=TRUE) - mean(citizen$IFEAgree[citizen$IFETreatment=="DUI"& citizen$IFEDeception==1],na.rm=TRUE),2) 
			
			
#### figure 2: acceptability of informational field experiments ####
			citizen.consent<-citizen[citizen$IFEDeception==0,]
			citizen.consent<-citizen.consent[!is.na(citizen.consent$IFEAgree),]
			
			citizen.noconsent<-citizen[citizen$IFEDeception==1,]
			citizen.noconsent<-citizen.noconsent[!is.na(citizen.noconsent$IFEAgree),]
			
			scholar.consent<-scholar[scholar$IFEDeception==0,]
			scholar.consent<-scholar.consent[!is.na(scholar.consent$IFEAgree),]
			
			scholar.noconsent<-scholar[scholar$IFEDeception==1,]
			scholar.noconsent<-scholar.noconsent[!is.na(scholar.noconsent$IFEAgree),]
			
			ggplot(citizen.consent, aes(x=factor(IFEAgree),y=IFEAgree)) + 
			  geom_bar(aes(y = (..count..)/sum(..count..))) + 
			  labs(title = "Subjects, Consent")+
			  xlab(" ") + ylab(" ") +theme_bw() + coord_flip()
			
			ggplot(scholar.consent, aes(x=factor(IFEAgree),y=IFEAgree)) + 
			  geom_bar(aes(y = (..count..)/sum(..count..))) + 
			  labs(title = "Scholars, Consent")+
			  xlab(" ") + ylab(" ") +theme_bw() + coord_flip()
			
			ggplot(citizen.noconsent, aes(x=factor(IFEAgree),y=IFEAgree)) + 
			  geom_bar(aes(y = (..count..)/sum(..count..))) + 
			  labs(title = "Subjects, No Consent")+
			  xlab(" ") + ylab(" ") +theme_bw() + coord_flip()
			
			ggplot(scholar.noconsent, aes(x=factor(IFEAgree),y=IFEAgree)) + 
			  geom_bar(aes(y = (..count..)/sum(..count..))) + 
			  labs(title = "Scholars, No Consent")+
			  xlab(" ") + ylab(" ") +theme_bw() + coord_flip()
			
	#### text #### 
			#scholars consent
			#modal response 
			table(scholar.consent$IFEAgree)
			mode <- function(x) {
			  ux <- unique(x)
			  ux[which.max(tabulate(match(x, ux)))]
			}
			mode(scholar.consent$IFEAgree)
			#acceptable range, 5-7 
			round(sum(scholar.consent$IFEAgree==5|scholar.consent$IFEAgree==6|scholar.consent$IFEAgree==7)/length(scholar.consent$IFEAgree),2)
			
			#most common response 
			table(scholar.noconsent$IFEAgree)
			#neither agree nor disagree response 
			round(sum(scholar.noconsent$IFEAgree==4)/length(scholar.consent$IFEAgree),2)
			
		#citizens consent  
			#at least "somewhat acceptable"
			round(sum(citizen.consent$IFEAgree>=5)/length(citizen.consent$IFEAgree),2)
			round(sum(citizen.noconsent$IFEAgree>=5)/length(citizen.noconsent$IFEAgree),2)
			#modal response 
			table(citizen.consent$IFEAgree)
			mode(citizen.consent$IFEAgree)
			table(citizen.noconsent$IFEAgree)
			mode(citizen.noconsent$IFEAgree)
			#disagree acceptable
			round(sum(citizen.consent$IFEAgree<=3)/length(citizen.consent$IFEAgree),2)
			round(sum(citizen.noconsent$IFEAgree<=3)/length(citizen.noconsent$IFEAgree),2)
			
			##text surrounding figure 1 bottom left figure
			#did not want to participate 
			#with consent 
			round(mean(citizen$IFEWouldNot[citizen$IFEDeception==0 & citizen$IFETreatment=="GOTV"],na.rm = TRUE),2)
			round(mean(citizen$IFEWouldNot[citizen$IFEDeception==0 & citizen$IFETreatment=="Floss"],na.rm = TRUE),2)
			round(mean(citizen$IFEWouldNot[citizen$IFEDeception==0 & citizen$IFETreatment=="DUI"],na.rm=TRUE),2)
			
			#without consent 
			round(mean(citizen$IFEWouldNot[citizen$IFEDeception==1 & citizen$IFETreatment=="GOTV"],na.rm = TRUE),2)
			round(mean(citizen$IFEWouldNot[citizen$IFEDeception==1 & citizen$IFETreatment=="Floss"],na.rm = TRUE),2)
			round(mean(citizen$IFEWouldNot[citizen$IFEDeception==1 & citizen$IFETreatment=="DUI"],na.rm=TRUE),2)
			
			
	#### multivariate models: table 2 in appendix ####
			mod.c1<-lm(IFEAgree~IFEDeception + GOTV + DUI + IFEFake + IFESize100k + IFEClose ,data=citizen)
			summary(mod.c1)
			nobs(mod.c1)
			mod.s1<-lm(IFEAgree~IFEDeception + GOTV + DUI + IFEFake + IFESize100k + IFEClose ,data=scholar)
			summary(mod.s1)
			nobs(mod.s1)
			mod.c2<-lm(IFEAgree~IFEDeception + IFEDeception*GOTV + IFEDeception*DUI + IFEFake + IFEDeception*IFESize100k + IFEDeception*IFEClose ,data=citizen)
			summary(mod.c2)
			nobs(mod.c2)
			mod.s2<-lm(IFEAgree~IFEDeception + IFEDeception*GOTV + IFEDeception*DUI + IFEFake + IFEDeception*IFESize100k + IFEDeception*IFEClose ,data=scholar)
			summary(mod.s2)
			nobs(mod.s2)
			
			mod.c3<-lm(IFEAgree~IFEDeception + IFEDeception*GOTV + IFEDeception*DUI + IFEFake + IFEDeception*IFESize100k + IFEDeception*IFEClose + IProfIFEProfNameJ + IProfIFEProfNameK + IProfIFEProfNameL + 
			             Education + Female + Age + White + Black + Asian + NativeAmerican + Latino + OtherRace,data=citizen)
			summary(mod.c3)
			nobs(mod.c3)
			
		# specify excluded categories 
			
			mod.s3<-lm(IFEAgree~IFEDeception + IFEDeception*GOTV + IFEDeception*DUI + IFEFake + IFEDeception*IFESize100k + IFEDeception*IFEClose + IProfIFEProfNameJ +	IProfIFEProfNameK	+ IProfIFEProfNameL  + 
			             Female + Age + White + Black + Asian + NativeAmerican + Latino + OtherRace + EverIRB + EverExperiment + American + Comparative + IR + Methods + Theory + OtherField +
			           IInstitutionMA + IInstitutionBA + IInstitutionCC + IInstitutionOther + IPositionGS + IPositionPD  + IPositionAS + IPositionFP + IPositionOT
			            ,data=scholar)
			summary(mod.s3)
			nobs(mod.s3)
			
	#### logistic regressions: table 3 in appendix ####
			logit1<-glm(IFEWouldNot~ IFEDeception + GOTV + DUI + IFEFake + IFESize100k + IFEClose,data=citizen,family=binomial)
			summary(logit1)
			nobs(logit1)
			
			logit2<-glm(IFEWouldNot~IFEDeception + IFEDeception*GOTV + IFEDeception*DUI + IFEFake + IFEDeception*IFESize100k + IFEDeception*IFEClose, data= citizen, family="binomial")
			summary(logit2)
			nobs(logit2)
			
			logit3<- glm(IFEWouldNot~IFEDeception + IFEDeception*GOTV + IFEDeception*DUI + IFEFake + IFEDeception*IFESize100k + IFEDeception*IFEClose + IProfIFEProfNameJ + IProfIFEProfNameK + IProfIFEProfNameL + 
			  Education + Female + Age + White + Black + Asian + NativeAmerican + Latino + OtherRace,data=citizen, family="binomial")
			summary(logit3)
			nobs(logit3)
			
	##### correspondence study field experiment ######
			
			##### figure 3: attitudes toward correspondence study field experiments ####plot1<-data.frame(matrix(ncol = 5, nrow = 9)) ######
			plot1<-data.frame(matrix(ncol = 5, nrow = 9))
			colnames(plot1)<-c("FETarget","FEDeception","FEDebrief","mean","se")
			plot1$FETarget<-c("govtoff","govtoff","govtoff","business","business","business","homeowner","homeowner","homeowner")
			plot1$FEDeception<-c(0,1,1,0,1,1,0,1,1)
			plot1$FEDebrief<-c(0,0,1,0,0,1,0,0,1)
			plot1$newvar[plot1$FEDeception==0]<-"Consent" # consent 
			plot1$newvar[plot1$FEDeception==1 & plot1$FEDebrief==0]<-"No Consent" # no consent and no debrief
			plot1$newvar[plot1$FEDeception==1 & plot1$FEDebrief==1]<-"No Consent, Debrief" #no consent, debrief
			
			#make the means and ses for each 
			#politician
			plot1$mean[plot1$FETarget=="govtoff" & plot1$FEDeception==1 & plot1$FEDebrief==1]<-
			  mean(citizen$FEAgree[citizen$FETarget=="govtoff" & citizen$FEDeception==1 & citizen$FEDebrief==1],na.rm = TRUE)
			plot1$se[plot1$FETarget=="govtoff" & plot1$FEDeception==1 & plot1$FEDebrief==1]<-
			  sd(citizen$FEAgree[citizen$FETarget=="govtoff" & citizen$FEDeception==1  & citizen$FEDebrief==1],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="govtoff" & citizen$FEDeception==1  & citizen$FEDebrief==1,na.rm = TRUE))
			
			plot1$mean[plot1$FETarget=="govtoff" & plot1$FEDeception==1 & plot1$FEDebrief==0]<-
			  mean(citizen$FEAgree[citizen$FETarget=="govtoff" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE)
			plot1$se[plot1$FETarget=="govtoff" & plot1$FEDeception==1 & plot1$FEDebrief==0]<-
			  sd(citizen$FEAgree[citizen$FETarget=="govtoff" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="govtoff" & citizen$FEDeception==1 & citizen$FEDebrief==0,na.rm = TRUE))
			
			plot1$mean[plot1$FETarget=="govtoff" & plot1$FEDeception==0]<-
			  mean(citizen$FEAgree[citizen$FETarget=="govtoff" & citizen$FEDeception==0],na.rm = TRUE)
			plot1$se[plot1$FETarget=="govtoff" & plot1$FEDeception==0]<-
			  sd(citizen$FEAgree[citizen$FETarget=="govtoff" & citizen$FEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="govtoff" & citizen$FEDeception==0,na.rm = TRUE))
			
			#business
			plot1$mean[plot1$FETarget=="business" & plot1$FEDeception==1 & plot1$FEDebrief==1]<-
			  mean(citizen$FEAgree[citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==1],na.rm = TRUE)
			plot1$se[plot1$FETarget=="business" & plot1$FEDeception==1 & plot1$FEDebrief==1]<-
			  sd(citizen$FEAgree[citizen$FETarget=="business" & citizen$FEDeception==1  & citizen$FEDebrief==1],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="business" & citizen$FEDeception==1  & citizen$FEDebrief==1,na.rm = TRUE))
			
			plot1$mean[plot1$FETarget=="business" & plot1$FEDeception==1 & plot1$FEDebrief==0]<-
			  mean(citizen$FEAgree[citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE)
			plot1$se[plot1$FETarget=="business" & plot1$FEDeception==1 & plot1$FEDebrief==0]<-
			  sd(citizen$FEAgree[citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==0,na.rm = TRUE))
			
			plot1$mean[plot1$FETarget=="business" & plot1$FEDeception==0]<-
			  mean(citizen$FEAgree[citizen$FETarget=="business" & citizen$FEDeception==0],na.rm = TRUE)
			plot1$se[plot1$FETarget=="business" & plot1$FEDeception==0]<-
			  sd(citizen$FEAgree[citizen$FETarget=="business" & citizen$FEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="business" & citizen$FEDeception==0,na.rm = TRUE))
			
			#homeowner
			plot1$mean[plot1$FETarget=="homeowner" & plot1$FEDeception==1 & plot1$FEDebrief==1]<-
			  mean(citizen$FEAgree[citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==1],na.rm = TRUE)
			plot1$se[plot1$FETarget=="homeowner" & plot1$FEDeception==1 & plot1$FEDebrief==1]<-
			  sd(citizen$FEAgree[citizen$FETarget=="homeowner" & citizen$FEDeception==1  & citizen$FEDebrief==1],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="homeowner" & citizen$FEDeception==1  & citizen$FEDebrief==1,na.rm = TRUE))
			
			plot1$mean[plot1$FETarget=="homeowner" & plot1$FEDeception==1 & plot1$FEDebrief==0]<-
			  mean(citizen$FEAgree[citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE)
			plot1$se[plot1$FETarget=="homeowner" & plot1$FEDeception==1 & plot1$FEDebrief==0]<-
			  sd(citizen$FEAgree[citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==0,na.rm = TRUE))
			
			plot1$mean[plot1$FETarget=="homeowner" & plot1$FEDeception==0]<-
			  mean(citizen$FEAgree[citizen$FETarget=="homeowner" & citizen$FEDeception==0],na.rm = TRUE)
			plot1$se[plot1$FETarget=="homeowner" & plot1$FEDeception==0]<-
			  sd(citizen$FEAgree[citizen$FETarget=="homeowner" & citizen$FEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="homeowner" & citizen$FEDeception==0,na.rm = TRUE))
			
			#plot
			plot1$FETarget[plot1$FETarget=="govtoff"]<-"Politician"
			plot1$FETarget[plot1$FETarget=="business"]<-"Business"
			plot1$FETarget[plot1$FETarget=="homeowner"]<-"Homeowner"
			
			ggplot(data=plot1,
			       aes(x=FETarget, y=mean, group=newvar))+
			  geom_errorbar(aes(ymin=(mean-1.96*se), ymax=mean+1.96*se), width=.1) +
			  scale_x_discrete(limits=c("Politician","Business","Homeowner"))+
			  geom_point()+
			  geom_line(aes(linetype = as.factor(newvar)))+
			  ylim(1, 7)+
			  labs(title = "Agree Acceptable \n Subjects", linetype="")+
			  xlab("Target") + ylab("Agree Acceptable") +theme_bw()
			
			
			#scholars 
			plot2<-data.frame(matrix(ncol = 5, nrow = 9))
			colnames(plot2)<-c("FETarget","FEDeception","FEDebrief","mean","se")
			plot2$FETarget<-c("govtoff","govtoff","govtoff","business","business","business","homeowner","homeowner","homeowner")
			plot2$FEDeception<-c(0,1,1,0,1,1,0,1,1)
			plot2$FEDebrief<-c(0,0,1,0,0,1,0,0,1)
			plot2$newvar[plot2$FEDeception==0]<-"Consent" # consent 
			plot2$newvar[plot2$FEDeception==1 & plot2$FEDebrief==0]<-"No Consent" # no consent and no debrief
			plot2$newvar[plot2$FEDeception==1 & plot2$FEDebrief==1]<-"No Consent, Debrief" #no consent, debrief
			
			#make the means and ses for each 
			#politician
			plot2$mean[plot2$FETarget=="govtoff" & plot2$FEDeception==1 & plot2$FEDebrief==1]<-
			  mean(scholar$FEAgree[scholar$FETarget=="govtoff" & scholar$FEDeception==1 & scholar$FEDebrief==1],na.rm = TRUE)
			plot2$se[plot2$FETarget=="govtoff" & plot2$FEDeception==1 & plot2$FEDebrief==1]<-
			  sd(scholar$FEAgree[scholar$FETarget=="govtoff" & scholar$FEDeception==1  & scholar$FEDebrief==1],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="govtoff" & scholar$FEDeception==1  & scholar$FEDebrief==1,na.rm = TRUE))
			
			plot2$mean[plot2$FETarget=="govtoff" & plot2$FEDeception==1 & plot2$FEDebrief==0]<-
			  mean(scholar$FEAgree[scholar$FETarget=="govtoff" & scholar$FEDeception==1 & scholar$FEDebrief==0],na.rm = TRUE)
			plot2$se[plot2$FETarget=="govtoff" & plot2$FEDeception==1 & plot2$FEDebrief==0]<-
			  sd(scholar$FEAgree[scholar$FETarget=="govtoff" & scholar$FEDeception==1 & scholar$FEDebrief==0],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="govtoff" & scholar$FEDeception==1 & scholar$FEDebrief==0,na.rm = TRUE))
			
			plot2$mean[plot2$FETarget=="govtoff" & plot2$FEDeception==0]<-
			  mean(scholar$FEAgree[scholar$FETarget=="govtoff" & scholar$FEDeception==0],na.rm = TRUE)
			plot2$se[plot2$FETarget=="govtoff" & plot2$FEDeception==0]<-
			  sd(scholar$FEAgree[scholar$FETarget=="govtoff" & scholar$FEDeception==0],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="govtoff" & scholar$FEDeception==0,na.rm = TRUE))
			
			#business
			plot2$mean[plot2$FETarget=="business" & plot2$FEDeception==1 & plot2$FEDebrief==1]<-
			  mean(scholar$FEAgree[scholar$FETarget=="business" & scholar$FEDeception==1 & scholar$FEDebrief==1],na.rm = TRUE)
			plot2$se[plot2$FETarget=="business" & plot2$FEDeception==1 & plot2$FEDebrief==1]<-
			  sd(scholar$FEAgree[scholar$FETarget=="business" & scholar$FEDeception==1  & scholar$FEDebrief==1],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="business" & scholar$FEDeception==1  & scholar$FEDebrief==1,na.rm = TRUE))
			
			plot2$mean[plot2$FETarget=="business" & plot2$FEDeception==1 & plot2$FEDebrief==0]<-
			  mean(scholar$FEAgree[scholar$FETarget=="business" & scholar$FEDeception==1 & scholar$FEDebrief==0],na.rm = TRUE)
			plot2$se[plot2$FETarget=="business" & plot2$FEDeception==1 & plot2$FEDebrief==0]<-
			  sd(scholar$FEAgree[scholar$FETarget=="business" & scholar$FEDeception==1 & scholar$FEDebrief==0],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="business" & scholar$FEDeception==1 & scholar$FEDebrief==0,na.rm = TRUE))
			
			plot2$mean[plot2$FETarget=="business" & plot2$FEDeception==0]<-
			  mean(scholar$FEAgree[scholar$FETarget=="business" & scholar$FEDeception==0],na.rm = TRUE)
			plot2$se[plot2$FETarget=="business" & plot2$FEDeception==0]<-
			  sd(scholar$FEAgree[scholar$FETarget=="business" & scholar$FEDeception==0],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="business" & scholar$FEDeception==0,na.rm = TRUE))
			
			#homeowner
			plot2$mean[plot2$FETarget=="homeowner" & plot2$FEDeception==1 & plot2$FEDebrief==1]<-
			  mean(scholar$FEAgree[scholar$FETarget=="homeowner" & scholar$FEDeception==1 & scholar$FEDebrief==1],na.rm = TRUE)
			plot2$se[plot2$FETarget=="homeowner" & plot2$FEDeception==1 & plot2$FEDebrief==1]<-
			  sd(scholar$FEAgree[scholar$FETarget=="homeowner" & scholar$FEDeception==1  & scholar$FEDebrief==1],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="homeowner" & scholar$FEDeception==1  & scholar$FEDebrief==1,na.rm = TRUE))
			
			plot2$mean[plot2$FETarget=="homeowner" & plot2$FEDeception==1 & plot2$FEDebrief==0]<-
			  mean(scholar$FEAgree[scholar$FETarget=="homeowner" & scholar$FEDeception==1 & scholar$FEDebrief==0],na.rm = TRUE)
			plot2$se[plot2$FETarget=="homeowner" & plot2$FEDeception==1 & plot2$FEDebrief==0]<-
			  sd(scholar$FEAgree[scholar$FETarget=="homeowner" & scholar$FEDeception==1 & scholar$FEDebrief==0],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="homeowner" & scholar$FEDeception==1 & scholar$FEDebrief==0,na.rm = TRUE))
			
			plot2$mean[plot2$FETarget=="homeowner" & plot2$FEDeception==0]<-
			  mean(scholar$FEAgree[scholar$FETarget=="homeowner" & scholar$FEDeception==0],na.rm = TRUE)
			plot2$se[plot2$FETarget=="homeowner" & plot2$FEDeception==0]<-
			  sd(scholar$FEAgree[scholar$FETarget=="homeowner" & scholar$FEDeception==0],na.rm = TRUE) / sqrt(sum(scholar$FETarget=="homeowner" & scholar$FEDeception==0,na.rm = TRUE))
			
			#plot
			plot2$FETarget[plot2$FETarget=="govtoff"]<-"Politician"
			plot2$FETarget[plot2$FETarget=="business"]<-"Business"
			plot2$FETarget[plot2$FETarget=="homeowner"]<-"Homeowner"
			
			ggplot(data=plot2,
			       aes(x=FETarget, y=mean, group=newvar))+
			  geom_errorbar(aes(ymin=(mean-1.96*se), ymax=mean+1.96*se), width=.1) +
			  scale_x_discrete(limits=c("Politician","Business","Homeowner"))+
			  geom_point()+
			  geom_line(aes(linetype = as.factor(newvar)))+
			  ylim(1, 7)+
			  labs(title = "Agree Acceptable \n Scholars", linetype="")+
			  xlab("Target") + ylab("Agree Acceptable") +theme_bw()
			
			#would rather not participate
			plot3<-data.frame(matrix(ncol = 5, nrow = 6))
			colnames(plot3)<-c("FETarget","FEDeception","FEDebrief","mean","se")
			plot3$FETarget<-c("business","business","business","homeowner","homeowner","homeowner")
			plot3$FEDeception<-c(0,1,1,0,1,1)
			plot3$FEDebrief<-c(0,0,1,0,0,1)
			plot3$newvar[plot3$FEDeception==0]<-"Consent" # consent 
			plot3$newvar[plot3$FEDeception==1 & plot3$FEDebrief==0]<-"No Consent" # no consent and no debrief
			plot3$newvar[plot3$FEDeception==1 & plot3$FEDebrief==1]<-"No Consent, Debrief" #no consent, debrief
			
			#make the means and ses for each 
			#business
			plot3$mean[plot3$FETarget=="business" & plot3$FEDeception==1 & plot3$FEDebrief==1]<-
			  mean(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==1],na.rm = TRUE)
			plot3$se[plot3$FETarget=="business" & plot3$FEDeception==1 & plot3$FEDebrief==1]<-
			  sd(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==1  & citizen$FEDebrief==1],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="business" & citizen$FEDeception==1  & citizen$FEDebrief==1,na.rm = TRUE))
			
			plot3$mean[plot3$FETarget=="business" & plot3$FEDeception==1 & plot3$FEDebrief==0]<-
			  mean(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE)
			plot3$se[plot3$FETarget=="business" & plot3$FEDeception==1 & plot3$FEDebrief==0]<-
			  sd(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="business" & citizen$FEDeception==1 & citizen$FEDebrief==0,na.rm = TRUE))
			
			plot3$mean[plot3$FETarget=="business" & plot3$FEDeception==0]<-
			  mean(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==0],na.rm = TRUE)
			plot3$se[plot3$FETarget=="business" & plot3$FEDeception==0]<-
			  sd(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="business" & citizen$FEDeception==0,na.rm = TRUE))
			
			#homeowner
			plot3$mean[plot3$FETarget=="homeowner" & plot3$FEDeception==1 & plot3$FEDebrief==1]<-
			  mean(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==1],na.rm = TRUE)
			plot3$se[plot3$FETarget=="homeowner" & plot3$FEDeception==1 & plot3$FEDebrief==1]<-
			  sd(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==1  & citizen$FEDebrief==1],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="homeowner" & citizen$FEDeception==1  & citizen$FEDebrief==1,na.rm = TRUE))
			
			plot3$mean[plot3$FETarget=="homeowner" & plot3$FEDeception==1 & plot3$FEDebrief==0]<-
			  mean(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE)
			plot3$se[plot3$FETarget=="homeowner" & plot3$FEDeception==1 & plot3$FEDebrief==0]<-
			  sd(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="homeowner" & citizen$FEDeception==1 & citizen$FEDebrief==0,na.rm = TRUE))
			
			plot3$mean[plot3$FETarget=="homeowner" & plot3$FEDeception==0]<-
			  mean(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==0],na.rm = TRUE)
			plot3$se[plot3$FETarget=="homeowner" & plot3$FEDeception==0]<-
			  sd(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==0],na.rm = TRUE) / sqrt(sum(citizen$FETarget=="homeowner" & citizen$FEDeception==0,na.rm = TRUE))
			
			#plot
			plot3$FETarget[plot3$FETarget=="business"]<-"Business"
			plot3$FETarget[plot3$FETarget=="homeowner"]<-"Homeowner"
			
			ggplot(data=plot3,
			       aes(x=FETarget, y=mean, group=newvar))+
			  geom_errorbar(aes(ymin=(mean-1.96*se), ymax=mean+1.96*se), width=.1) +
			  scale_x_discrete(limits=c("Business","Homeowner"))+
			  geom_point()+
			  geom_line(aes(linetype = as.factor(newvar)))+
			  ylim(0, 1)+
			  labs(title = "Would Rather Not Participate \n Subjects", linetype="")+
			  xlab("Target") + ylab("Proportion") +theme_bw()
			
		#### text ####
		# scholars 
		# fully informed
			mean(scholar$FEAgree[scholar$FEDeception==0],na.rm = TRUE)
			# with deception
			mean(scholar$FEAgree[scholar$FEDeception==1],na.rm = TRUE)
			# difference 
			mean(scholar$FEAgree[scholar$FEDeception==0],na.rm = TRUE) - mean(scholar$FEAgree[scholar$FEDeception==1],na.rm = TRUE)
			
		# citizens 
			mean(citizen$FEAgree[citizen$FEDeception==0],na.rm = TRUE) - mean(citizen$FEAgree[citizen$FEDeception==1],na.rm = TRUE)
			
		#### multivariate models: table 4 in appendix ####
			modc1<-lm(FEAgree~  FEDeception + FEBiz + FEGovtOfficial + FEDiscrimination  + FESize + FELength + FEDebrief, data= citizen)
			summary(modc1)
			nobs(modc1)
			
			mods1<-lm(FEAgree~  FEDeception + FEBiz + FEGovtOfficial + FEDiscrimination  + FESize + FELength + FEDebrief, data= scholar)
			summary(mods1)
			nobs(mods1)
			
			modc2<-lm(FEAgree~  FEDeception*FEBiz + FEDeception*FEGovtOfficial + FEDeception*FEDiscrimination + FEDeception*FESize + FEDeception*FELength + FEDebrief, data= citizen)
			summary(modc2)
			nobs(modc2)
			
			mods2<-lm(FEAgree~  FEDeception*FEBiz + FEDeception*FEGovtOfficial + FEDeception*FEDiscrimination + FEDeception*FESize + FEDeception*FELength + FEDebrief, data= scholar)
			summary(mods2)
			nobs(mods2) 
			
			modc3<-lm(FEAgree~  FEDeception*FEBiz + FEDeception*FEGovtOfficial + FEDeception*FEDiscrimination + FEDeception*FESize + FEDeception*FELength + FEDebrief + 
			            IProfFieldProfNameJ + IProfFieldProfNameK + IProfFieldProfNameL + Education + Female + Age + White + Black + Asian + NativeAmerican + Latino + OtherRace, data= citizen)
			summary(modc3)
			nobs(modc3)
			
			mods3<-lm(FEAgree~  FEDeception*FEBiz + FEDeception*FEGovtOfficial + FEDeception*FEDiscrimination + FEDeception*FESize + FEDeception*FELength + FEDebrief + 
			            IProfFieldProfNameJ + IProfFieldProfNameK + IProfFieldProfNameL + Female + Age + White + Black + Asian + NativeAmerican + Latino + OtherRace +
			            EverIRB + EverExperiment + American + Comparative + IR + Methods + Theory + OtherField +
			            IInstitutionMA + IInstitutionBA + IInstitutionCC + IInstitutionOther + IPositionGS + IPositionPD  + IPositionAS + IPositionFP + IPositionOT
			          , data= scholar)
			summary(mods3)
			nobs(mods3)
			
	##### text ####
		# figure 3 lower left panel: would rather not participants 
			# business with informed consent 
			round(mean(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==0], na.rm = TRUE),2)
			# homeowner with informed consent 
			round(mean(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==0], na.rm = TRUE),2)
			# business without informed consent 
			round(mean(citizen$FEWouldNot[citizen$FETarget=="business" & citizen$FEDeception==1], na.rm = TRUE),2)
			# homeowner without informed consent 
			round(mean(citizen$FEWouldNot[citizen$FETarget=="homeowner" & citizen$FEDeception==1], na.rm = TRUE),2)
			
		#### logistic regression : table 5 in appendix ####
			log1<-glm(FEWouldNot ~  FEDeception + FEBiz + FEDiscrimination  + FESize + FELength + FEDebrief,data=citizen,family=binomial)
			summary(log1)
			nobs(log1)
			
			log2<-glm(FEWouldNot ~  FEDeception*FEBiz + FEDeception*FEDiscrimination + FEDeception*FESize + FEDeception*FELength + FEDebrief,
			          data= citizen, family= "binomial")
			summary(log2)
			nobs(log2)
			
			log3<-glm(FEWouldNot ~  FEDeception*FEBiz + FEDeception*FEDiscrimination + FEDeception*FESize + FEDeception*FELength + FEDebrief + 
			             IProfFieldProfNameJ + IProfFieldProfNameK + IProfFieldProfNameL + Homeowner + BusinessOwner + Education + Female + Age + White + Black + Asian + NativeAmerican + Latino + OtherRace
			           ,data=citizen, family="binomial")
			summary(log3)
			nobs(log3)

